package com.stone.compose.ui.screen.message

import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

@Preview(showBackground = true, backgroundColor = 0xfff)
@Composable
fun MessageScreen() {

    LazyColumn(
        modifier = Modifier
            .padding(16.dp)
            .fillMaxWidth()
            .wrapContentSize()
    ) {

        items(36) {

            message()
        }

    }


}

@Composable
fun message() {

    Box(
        modifier = Modifier
            .padding(top = 10.dp)
            .fillMaxWidth()
            .wrapContentSize()
            .border(0.5.dp, Color.LightGray, shape = RoundedCornerShape(6.dp))
            .padding(10.dp)

    ) {

        Column(modifier = Modifier
            .fillMaxWidth()
            .wrapContentSize()) {

            Text(
                text = "AAAAAA", modifier = Modifier
                    .fillMaxWidth()
                    .size(16.dp)
            )
            Text(
                text = "bbbbbbbbbbbb", modifier = Modifier
                    .fillMaxWidth()
                    .size(12.dp)
            )
        }
    }

}
